<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<link rel="stylesheet" type="text/css" href="main.css" />
<title>List of Open Issues</title>
</head>
<body>
	<%@include file="header.jsp"%>
	<article> <s:set name="jissues" value="issues"
		scope="request" /> <s:set name="jfirstResult" value="firstResult"
		scope="request" /> <c:choose>
		<c:when test="${empty jissues }">
			There are no open issues!<br />
		</c:when>
		<c:otherwise>
			Open Issues! <br />
			<table>
				<tr>
					<th>Book</th>
					<th>Borrowed by</th>
					<th>Due date</th>
				</tr>
				<c:forEach var="item" items="${jissues}">
					<tr>
						<td><a href="bookDetails?bookId=${item.bookId}">${item.bookName}</a></td>
						<td>${item.userName}</td>
						<td>${item.dueDate}</td>
					</tr>
				</c:forEach>
			</table>
		</c:otherwise>
	</c:choose> <c:if test="${jfirstResult > '0'}">
		<a href="listIssues?firstResult=${jfirstResult}">Next page</a>
	</c:if> </article>
	<%@include file="footer.jsp"%>
</body>
</html>